/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.TrainUserGroupBO;
import com.xy.biz.ts.domain.query.TrainUserGroupQuery;
import com.xy.biz.ts.domain.converter.TrainUserGroupConverter;
import com.xy.biz.ts.manager.TrainUserGroupManager;
import com.xy.biz.ts.dao.TrainUserGroupDao;

/**
 *
 *
 * @author wwj
 * @date 2021-4-1
 */
@Service
public class TrainUserGroupManagerImpl implements TrainUserGroupManager {

	@Autowired
	private TrainUserGroupDao trainUserGroupDao;

	@Override
	public int saveTrainUserGroup(TrainUserGroupBO trainUserGroupBO) {
		return trainUserGroupDao.saveTrainUserGroup(TrainUserGroupConverter.toPO(trainUserGroupBO));
	}

	@Override
	public int saveAllTrainUserGroup(Collection<TrainUserGroupBO> collection) {
		return trainUserGroupDao.saveAllTrainUserGroup(TrainUserGroupConverter.toPO(collection));
	}

	@Override
	public int updateTrainUserGroup(TrainUserGroupBO trainUserGroupBO) {
		return trainUserGroupDao.updateTrainUserGroup(TrainUserGroupConverter.toPO(trainUserGroupBO));
	}

	@Override
	public int updateTrainUserGroupReleaseFlag(TrainUserGroupBO trainUserGroupBO) {
		return trainUserGroupDao.updateTrainUserGroupReleaseFlag(TrainUserGroupConverter.toPO(trainUserGroupBO));
	}

	@Override
	public int deleteTrainUserGroup(Long trainUserGroupId) {
		return trainUserGroupDao.deleteTrainUserGroup(trainUserGroupId);
	}

	@Override
	public TrainUserGroupBO getTrainUserGroup(Long trainUserGroupId) {
		return TrainUserGroupConverter.fromPO(trainUserGroupDao.getTrainUserGroup(trainUserGroupId));
	}

	@Override
	public List<TrainUserGroupBO> listTrainUserGroupById(Collection<Long> collection) {
		return TrainUserGroupConverter.fromPO(trainUserGroupDao.listTrainUserGroupById(collection));
	}

	@Override
	public List<TrainUserGroupBO> listTrainUserGroup(TrainUserGroupQuery query) {
		return TrainUserGroupConverter.fromPO(trainUserGroupDao.listTrainUserGroup(query));
	}

	@Override
	public int countTrainUserGroup(TrainUserGroupQuery query) {
		return trainUserGroupDao.countTrainUserGroup(query);
	}

	@Override
	public void deleteTrainUserGroupByTrainId(Long trainId) {
		trainUserGroupDao.deleteTrainUserGroupByTrainId(trainId);
	}

}
